<template>
  <div id="contentBox">
    <div class="searchBox">
      <el-form :inline="true" ref="searchForm" :model="searchForm" label-width="96px">
        <el-form-item label="申请日期起" prop='startDate'>
          <el-date-picker :editable="false" @change="debounceSeach" v-model="searchForm.startDate" type="date" placeholder="选择日期" :picker-options="startDateOpt">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="申请日期止" prop='endDate'>
          <el-date-picker :editable="false" @change="debounceSeach" v-model="searchForm.endDate" type="date" placeholder="选择日期" :picker-options="endDateOpt">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="订单号" prop='orderNumber'>
          <el-input v-model="searchForm.orderNumber" placeholder="请输入搜索内容..." @input.native="debounceSeach"></el-input>
        </el-form-item>
        <el-form-item label="融资经销商" prop='dealerName'>
          <el-input v-model="searchForm.dealerName" placeholder="请输入搜索内容..." @input.native="debounceSeach">
          </el-input>
        </el-form-item>

        <el-form-item label="订单状态" prop='carOrderStatus'>
          <el-select v-model="searchForm.carOrderStatus" placeholder="请选择" @change="debounceSeach">
             <el-option label="全部" value=""></el-option>            
            <el-option v-for="(item,index) in carOrderStatusMap" :key="item" :label='item' :value="index">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item style="margin-bottom: 10px;">
          <el-button type="primary" @click="resetSearchForm('searchForm')">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div id="tableBox" style="margin:0 25px;">
      <el-table :data="tableData.data" border>
        <el-table-column label="订单号" fixed>
          <template scope="scope">
            <span>{{ scope.row.orderNumber }}</span>
          </template>
        </el-table-column>
        <el-table-column label="融资经销商">
          <template scope="scope">
            <span>{{ scope.row.dealerName}}</span>
          </template>
        </el-table-column>
        <el-table-column label="融资总金额（元）">
          <template scope="scope">
            <span>{{ scope.row.mortgageSumMoney| toFixed2 }}</span>
          </template>
        </el-table-column>
        <el-table-column label="订单状态">
          <template scope="scope">
            <span>{{ scope.row.carOrderStatusString}}</span>
          </template>
        </el-table-column>

        <el-table-column label="申请时间">
          <template scope="scope">
            <span>{{getDate( scope.row.carOrderAddTime)}}</span>
          </template>
        </el-table-column>

        <el-table-column label="操作" fixed="right">
          <template scope="scope">
            <el-button size="mini" type="success" v-show="scope.row.carOrderStatus=='10080'||scope.row.carOrderStatus=='10070'" @click.native="formIsEdit($event)"
              :data-carOrderId="scope.row.carOrderId">添加</el-button>
            <el-button type="info" size="mini" :data-carOrderId="scope.row.carOrderId" @click.native="formIsEdit($event)">查看</el-button>
          </template>
        </el-table-column>
      </el-table>

    </div>
    <el-dialog title="库融付款单列表" v-if="buttonValue==='查看'" :visible.sync="dialogSendData.dialogFormVisible" :lock-scroll='true'
      top=9%>
      <LookBill v-if='dialogSendData.dialogFormVisible' :buttonValue="buttonValue" @setButtonCode="setChildCode" :userType='userType' :carOrderId='carOrderId'></LookBill>
    </el-dialog>


    <el-dialog title="库融付款单管理" v-if="buttonValue==='添加'||buttonValue==='child查看'||buttonValue==='child编辑'" :visible.sync="dialogSendData.dialogFormVisible"
      :lock-scroll='true' top=9%>
      <AddOrCompileBill v-if='dialogSendData.dialogFormVisible' :dialogSendData='dialogSendData' :buttonValue='buttonValue'  :carOrderId='carOrderId' :id='id'
        @Refresh='seachData()'></AddOrCompileBill>
    </el-dialog>


    <el-dialog title="库融付款单列表" v-if="buttonValue==='child审核'" :visible.sync="dialogSendData.dialogFormVisible" :lock-scroll='true'
      top=9%>
        <AuditBill v-if='dialogSendData.dialogFormVisible' :dialogSendData='dialogSendData' :carOrderId='carOrderId' :id="id" @Refresh="seachData()" ></AuditBill>
    </el-dialog>

    <div class="block" style="text-align: center;margin-top: 15px;position:relative;">
		    <pagination v-on:refreshSeachData="seachData()"  :tableData="tableData" :searchForm="searchForm"></pagination>
		</div>
 

  </div>
</template>


<script src='./index.js'>


</script>

